package uk.ac.lkl.common.util.property;



import uk.ac.lkl.common.util.Property;


/**
 * A string property.
 * 
 * @author Darren Pearce
 * @version $Revision$
 * @version $Date$
 * 
 */
public class StringProperty extends Property {

    /**
     * The value of this property.
     * 
     */
    private String value;


    /**
     * Create a new instance with the given name.
     * 
     * @param name
     *            the name of this instance
     * 
     */
    public StringProperty(String name) {
        super(name);
    }

	public boolean doSetValue(String value) throws IllegalArgumentException {
        if (this.value != null && this.value.equals(value))
            return false;
        this.value = value;
        return true;
    }


    /**
     * Get the value of this property.
     * 
     * @return the string value of this property (the value itself)
     * 
     */
    public String getValue() {
        return value;
    }


    /**
     * Get the type of this property.
     * 
     */
    public String getType() {
        return "String";
    }
}
